target = testSevent
srcs = test.cpp
libs = src/log/lib/liblog.a src/libsevent.a
subdirs = 
INCLUDE = -I./ -Isrc/log/include/ -Isrc/ 
LIBRARY = -lpthread -lrt
CPPFLAGS = -O2
all : $(target)

objs=$(patsubst %.cpp, %.o, $(srcs))

all : $(target)

$(target) : $(objs) 
	for dir in $(subdirs); do make -C $$dir ; done
#	ar cr $(target) $^ $(libs)
	g++ $(INCLUDE) $(CPPFLAGS) -o $(target) $^ $(libs) $(LIBRARY) 

%.o : %.cpp
	g++ $(INCLUDE) $(CPPFLAGS) $< -c -o $@

.PHONY : clean
clean:
	rm -f $(objs)
	rm -f $(target)
